package com.xinzhang;

import java.util.List;

import com.asy.ui.base.ImageAndText;
import com.helper.SqlLiteHepler;
import com.information.UserInfo;

import android.app.Application;



public class BaseApp extends  Application{

	
	private String versioncontent="";
	

	private List<ImageAndText> imageList;
	
	private int finishindex;
	
	private long filesize;
	
	public long getFilesize() {
		return filesize;
	}

	public void setFilesize(long filesize) {
		this.filesize = filesize;
	}

	public int getFinishindex() {
		return finishindex;
	}

	public void setFinishindex(int finishindex) {
		this.finishindex = finishindex;
	}

	public String getImagepath() {
		return imagepath;
	}

	public void setImagepath(String imagepath) {
		this.imagepath = imagepath;
	}

	private String imagepath;
	
	private UserInfo userInfo;

	public UserInfo getUserInfo() {
		
		if(userInfo==null)
		{
			SqlLiteHepler sqlLiteHepler=new SqlLiteHepler(this);
			userInfo=sqlLiteHepler.getUserInfo();
			sqlLiteHepler.Close();
		}
		
		return userInfo;
	}
	
	
	public void DeleteUser() {
		
		this.userInfo = null;
	}
	
	public void setUserInfo(UserInfo userInfo) {
		
		SqlLiteHepler sqlLiteHepler=new SqlLiteHepler(this);
		if(!sqlLiteHepler.UserIsExist(userInfo.getUserid()))
		{	
			sqlLiteHepler.Insert(userInfo.getUserid(), userInfo.getUsername(), userInfo.getEmail());
			sqlLiteHepler.Close();
		}
		this.userInfo = userInfo;
		
	}

	public List<ImageAndText> getImageList() {
		return imageList;
	}

	public void setImageList(List<ImageAndText> imageList) {
		this.imageList = imageList;
	}

	public String getVersioncontent() {
		return versioncontent;
	}

	public void setVersioncontent(String versioncontent) {
		this.versioncontent = versioncontent;
	}
	

	
}
